<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::any('wechat/serve','Controller@serve');
Route::middleware(['wechat.oauth'])->prefix('game')->group(function(){
	Route::get('index','IndexController@index');
	Route::get('game','IndexController@game');	
	Route::any('draw',	'IndexController@draw');	
	Route::any('save-info','IndexController@saveInfo');
	Route::any('save-coupon','IndexController@saveCoupon');
	Route::any('my-gift','IndexController@myGift');
	Route::any('times','IndexController@times');
	Route::any('test',   'IndexController@test');
});


Route::prefix('zadmin')->namespace('Admin')->group(function(){
	Route::middleware('checkAdmin')->group(function(){
		Route::get('system-info','SystemController@info');
		Route::get('system-update','SystemController@update');
		Route::resource('item',      'ItemController');
		Route::resource('result','LotteryResultController');		
		Route::resource('admins',     'AdminController');
		Route::resource('users',      'UserController');
		Route::resource('whitelist',  'WhitelistController');
		Route::resource('neiding',    'NeidingController');
		
		//后台首页
		Route::get('/',		   'IndexController@index');

		Route::get('log/index','LogController@index');
		// 兑奖
		Route::post('lottery-converte','IndexController@lotteryConverte');
		Route::get('lottery-info/{id}','IndexController@lotteryInfo');
		Route::get('info-to-redis','GiftController@infoToRedis');
		Route::get('num-to-redis','GiftController@numToRedis');
		Route::resource('gift',      'GiftController');



		
	});
		Route::get('login',    'LoginController@login');
		Route::post('logindo', 'LoginController@loginDo');
		Route::get('logout',   'LoginController@logOut');
		
		
	
});
